﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CAATS_Registration
{
    public class dataRecord
    {
        public string _strCountry;
        public string _strOrganization;
        public string _strGVRCnt;
        public string _strOVRCnt;
        public string _strGOVRCnt;
        public string _strDateCheckIn;
        public string _strDateDeparture;
        public string _strGVRSmokingCnt;
        public string _strOVRSmokingCnt;
        public string _strGOVRSmokingCnt;

        public Int32 _infoCnt;
        public string _strMemberCnt;
        public ContactInfo_[] m_listInfos;
        public bool m_bPersonal;
        private static dataRecord instance = null;
        protected dataRecord() 
        {
            m_bPersonal = false;
            m_listInfos = new ContactInfo_[5];
            for (int i = 0; i < 5; i++  )
            {
                m_listInfos[i] = new ContactInfo_();
            }
        }
        public static dataRecord Instance()
        {
            if (instance == null)
                instance = new dataRecord();
            return instance;
        }

        public string organization
        {
            get
            {
                return _strOrganization;
            }
            set
            {
                _strOrganization = value;
            }

        }
        public string country
        {
            get
            {
                return _strCountry;
            }
            set
            {
                _strCountry = value;
            }
        }

        public ContactInfo_ getInfo(Int32 idx)
        {
            return m_listInfos[idx];
            //m_listInfos.Add(_info);
        }
        public void clear()
        {
        }
    }


    public class ContactInfo_
    {
        public string _strFullName;
        public string _strTitle;

        public string _strFullAddress;
        public string _strStateOrganization;
        public string _strTel;
        public string _strFax;
        public string _strEmail;
        public string _strpassportNumber;
        public string _strDateofIssue;
        public string _strDateofExpiry;
        public string _strPRC;
        public string _strNationality;
        public string _strNationlityValue;
        public ContactInfo_()
        {
            _strFullName = "";
            _strTitle = "";
            _strFullAddress = "";
            _strStateOrganization = "";
            _strTel = "";
            _strFax = "";
            _strEmail = "";
            _strpassportNumber = "";
            _strDateofIssue = "";
            _strDateofExpiry = "";
            _strPRC = "";
            _strNationality = "";
            _strNationlityValue = "0";
            
        }
        public bool needReInput()
        {
            if (_strFullName.Equals(""))
                return true;
            if (_strTitle.Equals(""))
                return true;
            if (_strEmail.Equals(""))
                return true;
            if (_strpassportNumber.Equals(""))
                return true;
            if (_strTel.Equals(""))
                return true;
            //if ( !_strpassportNumber.Equals("") )
            //{
            //    if (_strDateofIssue.Equals(""))
            //        return true;
            //    if (_strDateofExpiry.Equals(""))
            //        return true;
            //    if (_strPRC.Equals(""))
            //        return true;
            //    if ( _strNationlityValue.Equals("0"))
            //        return true;

            //}
            return false;

        }
    }
}
